package com.zpark.mapper;

import com.zpark.pojo.GoodsType;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface GoodsTypeMapper {
    @Select(value = "select * from goods_type where goods_type_id = #{goodsTypeId, jdbcType=INTEGER}")
    @Results
    GoodsType selectOne(Integer id);

    @Insert(value = "insert into goods_type(goods_type_id,goods_type_name) values(#{goodsTypeId, jdbcType=INTEGER},#{goodsTypeName, jdbcType=VARCHAR})")
    @Results
    void insertOne(GoodsType goodsType);

    @Update(value = "update goods_type set goods_type_name= #{goodsTypeName, jdbcType=VARCHAR} WHERE goods_type_id = #{GoodsTypeId,jdbcType=INTEGER}")
    @Results
    void update(GoodsType goodsType);

    @Delete(value = "delete from goods_type where goods_type_id = #{goodsTypeId, jdbcType=INTEGER}")
    @Results
    void deleteOne(Integer id);
}
